# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1Content do
  @moduledoc """
  Content represents a user-visible notebook or a sql script

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Content creation time.
  *   `dataText` (*type:* `String.t`, *default:* `nil`) - Required. Content data in string format.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. Description of the content.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. User defined labels for the content.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The relative resource name of the content, of the form: projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}
  *   `notebook` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ContentNotebook.t`, *default:* `nil`) - Notebook related configurations.
  *   `path` (*type:* `String.t`, *default:* `nil`) - Required. The path for the Content file, represented as directory structure. Unique within a lake. Limited to alphanumerics, hyphens, underscores, dots and slashes.
  *   `sqlScript` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ContentSqlScript.t`, *default:* `nil`) - Sql Script related configurations.
  *   `uid` (*type:* `String.t`, *default:* `nil`) - Output only. System generated globally unique ID for the content. This ID will be different if the content is deleted and re-created with the same name.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the content was last updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :dataText => String.t() | nil,
          :description => String.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :notebook => GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ContentNotebook.t() | nil,
          :path => String.t() | nil,
          :sqlScript =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ContentSqlScript.t() | nil,
          :uid => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:dataText)
  field(:description)
  field(:labels, type: :map)
  field(:name)
  field(:notebook, as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ContentNotebook)
  field(:path)
  field(:sqlScript, as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1ContentSqlScript)
  field(:uid)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1Content do
  def decode(value, options) do
    GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1Content.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1Content do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
